﻿using System.Windows.Forms;
using AMM.Business;
using AMM.Business.Config;
using AMM.CustomWinComponents.Validator;

namespace AMM.UserControls {
    public partial class BaseEditControl : BaseControl {
        protected string RequiredMessage { get { return "必填"; } }
        protected int PageSize { get { return 20; } }

        public Validator ValidatorForEdit { get; set; }
        public virtual object BaseEditModel { get; set; }

        protected virtual void BindBasics(ListControl control, BasicsType basicsType) {
            control.DataSource = new BasicsProcessor().FetchEnabledBasicsByType(basicsType);
            control.DisplayMember = "Name";
            control.ValueMember = "BasicsId";
        }
    }
}
